Skip to content

Refactor register shutdown function mechanism #5829

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Jul 9, 2020

Use a more sane mechanism than what is currently in place.

@Girgias Girgias force-pushed the refactor-shutdown-function branch from 728d666 to 0ae973d Compare August 4, 2020 16:51
@Girgias Girgias force-pushed the refactor-shutdown-function branch 2 times, most recently from 5703a5c to ddb78c5 Compare May 8, 2021 14:21
@trowski trowski force-pushed the refactor-shutdown-function branch from ddb78c5 to 4917e47 Compare May 9, 2021 17:59
Use FCI/FCC structure instead of custom implementation which does the same.
This also fixes the "bug" which prevented static methods from being shutdown functions.

Co-authored-by: Aaron Piotrowski <aaron@trowski.com>
@Girgias Girgias force-pushed the refactor-shutdown-function branch from da80874 to 26d2ac7 Compare May 10, 2021 11:21
Comment on lines +1780 to +1783
ZEND_PARSE_PARAMETERS_START(1, -1)
Z_PARAM_FUNC(entry.fci, entry.fci_cache)
Z_PARAM_VARIADIC('+', params, param_count);
ZEND_PARSE_PARAMETERS_END();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we keep the non Fast ZPP variant?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would make sense to me, though I don't care strongly. At least this should be using '*' insteadof '+' though (even though this is not actually used).

Comment on lines +1780 to +1783
ZEND_PARSE_PARAMETERS_START(1, -1)
Z_PARAM_FUNC(entry.fci, entry.fci_cache)
Z_PARAM_VARIADIC('+', params, param_count);
ZEND_PARSE_PARAMETERS_END();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would make sense to me, though I don't care strongly. At least this should be using '*' insteadof '+' though (even though this is not actually used).

@Girgias Girgias closed this in a9695cc May 10, 2021
@Girgias Girgias deleted the refactor-shutdown-function branch May 10, 2021 14:58
result = zend_fcall_info_init(&callable, 0, &shutdown_function_entry.fci,
&shutdown_function_entry.fci_cache, NULL, NULL);

ZEND_ASSERT(result == SUCCESS);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will break some extensions, it would be better to mention it in the internal changelog :)
In addition, if ZEND_ASSERT is empty, this may cause an unused variable warning, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can this break an extension, as if it's calling an internal function not part of itself it should declare it as a dependency.

I wouldn't worry about the compiler warning as I would expect for this to be understood by the preprocessor that it is used initially just in an empty macro, which can be optimized out.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as if it's calling an internal function not part of itself it should declare it as a dependency.

I tried but I can not understand...
I mean extensions need to change the code because the initialization way has changed.
In fact, there are many ZEND_API break changes now... We often receive notifications from CI that the extension built failed with php-master. But I believe all of the changes are pretty good, it just makes a little trouble for extension developers... Maybe we need to get used to these, so, forget this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants